Skip to content

Media Editor: Add bounded advanced crop controls - #78187

Open
ramonjd wants to merge 21 commits into
trunkfrom
try/image-editor-geometry-api-refactor
Open

ramonjd wants to merge 21 commits into
trunkfrom
try/image-editor-geometry-api-refactor

Conversation

@ramonjd

@ramonjd ramonjd commented May 12, 2026 •

Copy link
Copy Markdown
Member

What

Kapture.2026-06-10.at.16.08.40.mp4

Part of:

Alternative to:

Adds an Advanced panel to the media editor crop sidebar with manual controls for X, Y, width, height, and fine rotation.

While a numeric field is focused, the cropper paints a non-interactive preview rectangle for the candidate crop; the real setCropRect fires on blur or Enter. F

ine rotation stays live because visual feedback on the image itself is the point.

Why

The crop sidebar previously had no way to enter precise pixel values. The natural live-commit approach (apply the edit on every keystroke) made the cropper auto-pan/zoom to fit the new crop, which felt like the viewport sliding out from under the user as they typed. Painting a preview rect instead keeps the canvas stable while editing and finalises in one step at the natural completion boundary.

How

  • New advanced panel UI with X, Y, Width, Height, and Fine rotation inputs. Available only when freeform crop is on; X/Y disable otherwise.
  • New CropPreviewOverlay on the cropper. The Provider holds a previewCropRect slot that panel controls publish; the cropper renders the rectangle and dims the live stencil while a preview is active.
  • New useDeferredCommit hook drives the input lifecycle: live-commit by default, preview-only when commitOnChange is false. While focused, the typed value is sovereign and external state changes do not overwrite it. Blur, Enter, or Escape clamps and commits in one step; Escape rolls back.
  • New useAdvancedCropControls hook resolves geometry, computes per-field ranges, and exposes commit + preview handlers. Width/height ranges anchor to the current crop edge so coupled aspect-ratio edits cannot push the crop off the image.
  • New pauseHistory on useCropperState: input-driven sessions pause the auto-history debounce on focus and resume on blur, so a focus session lands as one undo entry rather than one per typing pause. Returns an idempotent resume callback. The cropper reducer now routes through a dispatchAction helper that mirrors reducer results synchronously, so same-event setter + commitHistory sequences see the right state.
  • New fineRotation policy in core. The bottom toolbar ruler and the advanced panel fine-rotation field both use it; offsets are pulled inside ±45 by a small epsilon so committing the boundary does not flip the snap base and let the rotation spiral past its intended range.
  • New applyCropEdit in core/crop-geometry. Single entry point for edit + aspect-ratio couple + clamp, with an aspect-ratio-aware envelope so locked-ratio edits cannot drift. validateCropPixelRectAgainstBounds returns a { ok: true | false } discriminated union; the symbol-branded CropPixelRect and the 'precision-clamped' violation are gone.
  • CropperProvider collapses to one context with the controller, the measured canvas size, and the derived measurements. <Cropper> publishes the raw canvas size; nothing pushes derived state back through a sibling context.

Manual testing

  1. Open the media editor and pick an image.
  2. Open the Crop sidebar tab and expand Advanced.
  3. Focus the Width field, type a new value. Confirm a dashed preview rectangle appears on the canvas. The live crop and the image position stay put while you type.
  4. Press Enter (or click elsewhere). Confirm the preview disappears, the crop snaps to the typed value, and the cropper settles.
  5. Press Escape on an in-progress edit. Confirm the field reverts to its focus-time value and no preview remains.
  6. Backspace a long value down past the input minimum, then type a new one. The field does not spring back mid-typing.
  7. With a fixed aspect ratio selected, edit Width. Confirm Height moves together and the preview stays inside the image.
  8. With the crop near the right edge, type a Width larger than the image can hold from the current X. Confirm the preview clamps to what fits.
  9. In the bottom toolbar, drag the fine rotation ruler to +45 and back, then repeat in the negative direction. Type 45 into the Advanced panel's Fine rotation, click away, type 45 again. The value does not spiral past 45.
  10. Apply a snap-90 rotation and a flip, then edit position and size in the Advanced panel. The fields accept values inside the visible image; the preview reflects them.
  11. Make several edits in the Advanced panel with pauses to think between keystrokes. Press Undo. One undo step reverts the whole focus session. Press Redo. It reapplies the same session.
  12. Toggle freeform off. Confirm Width and Height are disabled while X and Y remain editable.
  13. Open the panel, focus a field, then close the media editor without committing. Reopen and confirm there is no leftover preview rectangle and no history is stuck paused.

Use of AI

Mucho

@ramonjd ramonjd changed the title Try/image editor geometry api refactor Title: Media Editor: Share crop policy across panel, toolbar, and provider May 12, 2026
@ramonjd ramonjd changed the title Title: Media Editor: Share crop policy across panel, toolbar, and provider Media Editor: share crop policy across panel, toolbar, and provider May 12, 2026
@github-actions

github-actions Bot commented May 12, 2026 •

Copy link
Copy Markdown

Size Change: +4.16 kB (+0.05%)

Total Size: 7.92 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 584 kB +3.81 kB (+0.66%)
build/styles/editor/style-rtl.css 31.7 kB +88 B (+0.28%)
build/styles/editor/style-rtl.min.css 27.1 kB +91 B (+0.34%)
build/styles/editor/style.css 31.7 kB +87 B (+0.28%)
build/styles/editor/style.min.css 27.1 kB +89 B (+0.33%)

compressed-size-action

@ramonjd
ramonjd requested a review from Copilot May 12, 2026 02:13
@ramonjd ramonjd added [Feature] Media Anything that impacts the experience of managing media [Type] Experimental Experimental feature or API. labels May 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the media editor crop implementation so the advanced crop panel, bottom toolbar, and cropper/provider share centralized primitives for crop geometry, derived measurements, and fine rotation policy—reducing duplicated math and simplifying UI state handling.

Changes:

  • Introduces shared derivation/geometry primitives (useDerivedCropperMeasurements, useCropGeometry, core/crop-geometry, core/fine-rotation) and updates consumers to use them.
  • Reworks advanced crop inputs around useDeferredCommit and useAdvancedCropControls, making CropInput/panel components mostly render-only.
  • Updates toolbar fine-rotation behavior to use the shared fineRotation policy and updates server modifier building to use getCropPixelRect.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/media-editor/src/image-editor/react/hooks/use-derived-cropper-measurements.ts New shared hook to derive element/visual sizes + crop bounds from state + canvas size.
packages/media-editor/src/image-editor/react/hooks/use-crop-geometry.ts New hook exposing pixel crop geometry snapshot from provider state + measurements.
packages/media-editor/src/image-editor/react/hooks/test/use-crop-geometry.tsx Adds unit tests for useCropGeometry readiness and snapshot values.
packages/media-editor/src/image-editor/react/components/index.ts Exports useCropperMeasurements and CropperMeasurements from the components barrel.
packages/media-editor/src/image-editor/react/components/cropper.tsx Switches cropper to use the shared derived measurements hook and publishes canvas size to provider.
packages/media-editor/src/image-editor/react/components/cropper-provider.tsx Expands provider context to include controller + measured canvas size + derived measurements, plus helper hooks.
packages/media-editor/src/image-editor/docs/recipes.md Documentation updates (code fences, spacing, heading numbering tweaks).
packages/media-editor/src/image-editor/core/test/crop-geometry.ts Adds unit tests for new crop-geometry helpers (snapshot, validation, clamping, edits).
packages/media-editor/src/image-editor/core/index.ts Re-exports crop geometry helpers/types and fine rotation policy from core.
packages/media-editor/src/image-editor/core/fine-rotation.ts New shared fine rotation policy (range/step, offset conversion, safe absolute conversion).
packages/media-editor/src/image-editor/core/crop-geometry.ts New shared crop pixel geometry conversion/validation/editing utilities.
packages/media-editor/src/components/media-editor-toolbar/index.tsx Uses shared fineRotation for fine rotation slider offset + commits.
packages/media-editor/src/components/media-editor-modal/style.scss Adds styling to align advanced crop panel layout within the modal sidebar panel.
packages/media-editor/src/components/media-editor-modal/build-modifiers.ts Uses getCropPixelRect for snap-rotation crop pixel math when building REST modifiers.
packages/media-editor/src/components/media-editor-crop-panel/use-deferred-commit.ts New hook implementing draft/commit/finalize behavior for numeric inputs (Enter/Escape/blur).
packages/media-editor/src/components/media-editor-crop-panel/use-advanced-crop-controls.ts New hook wiring advanced crop panel inputs to cropper state + geometry + policies.
packages/media-editor/src/components/media-editor-crop-panel/test/use-deferred-commit.tsx Unit tests for deferred commit behavior and edge cases.
packages/media-editor/src/components/media-editor-crop-panel/test/use-advanced-crop-controls.tsx Unit tests for advanced crop control ranges and edit/rotation behavior.
packages/media-editor/src/components/media-editor-crop-panel/test/crop-input-utils.ts Unit tests for range/bounds/step snapping helpers.
packages/media-editor/src/components/media-editor-crop-panel/test/crop-advanced-panel.tsx Integration-style tests for advanced panel input behavior (typing, clamping, settle/history).
packages/media-editor/src/components/media-editor-crop-panel/index.tsx Mounts the new CropAdvancedPanel and passes resolved aspect ratio + flags.
packages/media-editor/src/components/media-editor-crop-panel/crop-input.tsx New renderer-only numeric input component using useDeferredCommit.
packages/media-editor/src/components/media-editor-crop-panel/crop-input-utils.ts New utilities for numeric input range/bounds and commit snapping/clamping.
packages/media-editor/src/components/media-editor-crop-panel/crop-advanced-panel.tsx New advanced panel markup component powered by useAdvancedCropControls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented May 12, 2026 •

Copy link
Copy Markdown

Flaky tests detected in 6a8a744.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33351554074
📝 Reported tests:

should allow user to add and remove multiple local font files in /test/e2e/specs/admin/font-library.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByLabel('Exo 2 Semi-bold Italic')
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" with timeout 5000ms
  - waiting for getByLabel('Exo 2 Semi-bold Italic')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/admin/font-library.spec.js:58:6

@ramonjd
ramonjd force-pushed the try/image-editor-geometry-api-refactor branch 2 times, most recently from d8dc3b5 to 33f1bbd Compare May 12, 2026 05:31
@ramonjd ramonjd self-assigned this May 12, 2026
@ramonjd
ramonjd marked this pull request as ready for review May 12, 2026 05:33
@ramonjd
ramonjd requested a review from andrewserong May 12, 2026 05:33
@ramonjd

ramonjd commented May 12, 2026

Copy link
Copy Markdown
Member Author

Undo/redo isn't consistent at the moment. Looking into that.

@andrewserong andrewserong left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice progress! Just a quick drive-by comment while I was testing the UX. In the main it's feeling really good to me, as we were discussing in the other PR.

I think I found one slighty strange edge case if using a mouse wheel within the Y field while the image is rotated. I found it's possible for the viewport to slide right away 😄

2026-05-12.17.23.16.mp4

It only seems to occur when the image has a fine rotation applied, not sure if that helps narrow things down!

In terms of adding pauseHistory and resumeHistory that does sounds really useful for cases beyond just what we're dealing with in these controls. While testing this out with an LLM, one question came up and that's whether we could simplify to just a pauseHistory method, but have it return a function to resume history?

E.g. something like:

  // Today — two calls, easy to drift apart
  pauseHistory();
  // ...
  resumeHistory();

  // RAII-style — release is the return value of acquire
  const resume = pauseHistory();
  // ...
  resume();

I had to look up what RAII means, and in this case I think Claude was maybe being a bit too clever in its explanation. But I think the point was something along the lines of, with this approach "the lifetime of the paused state is the lifetime of the callback". In any case, just thought I'd mention it in case it simplifies things at all, but feel free to disregard, especially if you think resuming needs to be independent!

I'll give this PR a closer look tomorrow 👍

@ramonjd

ramonjd commented May 12, 2026

Copy link
Copy Markdown
Member Author

I found it's possible for the viewport to slide right away

Oh yes, I can reproduce 😅 Thanks for testing again!

I'm going to take a step back and check if this feature has drifted into overengineering.

I think the trap I'm falling into is that I'm trying to make live edits behave like drag/resize. Text fields aren't crop handles, and it gets chaotic to try to predict and avoid every correction from the panel.

I think the base is sound:

  • advanced controls need accurate pixel geometry
  • AI/programmatic consumers need validation helpers

I'll just experiment to see whether there's another UX path here that doesn't explode the combo of wheel + bounds + canvas representation

🤔

@andrewserong

Copy link
Copy Markdown
Contributor

I think the base is sound:

  • advanced controls need accurate pixel geometry
  • AI/programmatic consumers need validation helpers

Same. For what it's worth, in this PR the UX you got to feels really good aside from that bug!

@ramonjd ramonjd changed the title Media Editor: share crop policy across panel, toolbar, and provider Media Editor: Add bounded advanced crop controls May 13, 2026
@ramonjd

ramonjd commented May 13, 2026

Copy link
Copy Markdown
Member Author

I committed an idea I had to preserve image bound values in the advanced controls, and remove all the complexity of trying to match drag handler behaviour: create a preview area for advanced controls. Screencast in the PR description.

So advanced crop fields no longer mutate the real cropper on every keystroke, but show a preview overlay while editing. The commit only happens onBlur/Enter. That lets the fields use image bounds like drag handles, without pushing the canvas off-screen mid-edit, and also removes the need for canvas-bound manual ranges and most of the live-edit/history edge cases.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Comment on lines +30 to +34
export const fineRotation = {
step: 0.5,
min: -MAX_ROTATION_OFFSET,
max: MAX_ROTATION_OFFSET,

Comment on lines +88 to +95
label={ __( 'X' ) }
aria-label={ __( 'Crop horizontal position' ) }
value={ rect.left }
range={ ranges.left }
disabled={
! canMoveCropRect || ! ranges.left.isEditable
}
commitOnChange={ false }
@andrewserong

Copy link
Copy Markdown
Contributor

I committed an idea I had to preserve image bound values in the advanced controls, and remove all the complexity of trying to match drag handler behaviour: create a preview area for advanced controls. Screencast in the PR description.

Neat idea! From a quick play that seems to be working quite nicely, especially for that bug. Couple of questions:

  • To make it more invisible to the user, I wonder if we could style it to basically look identical to the existing crop area, just with the drag handles hidden? I.e. make the transition very smooth so that to a user it's an optimistic rendering of the existing crop area rather than an additional preview UI. My thinking here is: it's useful to us as developers to think of this as a preview, but the user doesn't necessarily need to think of it as one.
  • I haven't looked at the code yet, but has this helped simplify things? I see this PR is now around 4k lines where the other PR was around 2k. Wasn't sure if that's just an artifact of this PR currently containing both approaches?

Overall though, the idea that the advanced controls render an optimistic view of what it might look like before committing, sounds like a pragmatic way to solve this!

@ramonjd

ramonjd commented May 13, 2026 •

Copy link
Copy Markdown
Member Author

I wonder if we could style it to basically look identical to the existing crop area, just with the drag handles hidden? I.

Yes styling was the thing I left last. Good idea!

I see this PR is now around 4k lines where the other PR was around 2k

Egad.

I did specifically say to document everything, so I'll see how much of that is comments+docs and what can be purged. Thanks again! 🙇🏻

@ramonjd

ramonjd commented May 13, 2026

Copy link
Copy Markdown
Member Author

I'll see how much of that is comments+docs and what can be purged.

Did a quick looksy:

  • core/crop-geometry.ts (549) — types-heavy, mostly necessary. Could shave the symbol brand (cropPixelRectBrand) if internal-only is the long-term plan. Maybe 30-40 lines of saving.
  • use-deferred-commit.ts (312) — central state machine, recently gained JSDoc comments. Tight enough.
  • use-advanced-crop-controls.ts (301) — has buildRanges plus four hook callbacks. Could be ~250 if the range-building was less verbose, but readability wins.
  • Tests (427)— large because they cover both unit (hooks in isolation) and integration (panel rendered) paths. Removing duplication would maybe save 200 lines but trade off coverage clarity.

Tests make up 49% of the PR 🙃

@andrewserong

Copy link
Copy Markdown
Contributor

Tests make up 49% of the PR 🙃

That's a good thing, better than it all being production code! I don't mind heaps of tests 😄
I sometimes find that Claude and Codex can be overly verbose in how they write tests, so might be worth doing a pass seeing if they can consolidate into helper functions, etc, where need be?

Let me know when you'd like some 👀 on the code side of things and I can take a peek.

@ramonjd

ramonjd commented May 13, 2026

Copy link
Copy Markdown
Member Author

Let me know when you'd like some 👀 on the code side of things and I can take a peek.

Thank you! I'm going to remove some duplication, and then work on the updated styles you recommended. Shan't be long!

ramonjd and others added 20 commits October 2, 2026 12:23
Adds an Advanced panel to the media editor crop sidebar with manual
controls for X, Y, width, height, and fine rotation. Controls update the
crop preview as the user types; the displayed value stays sovereign while
focused and clamps to bounds on blur or Enter.

Geometry API (core, internal):
- applyCropEdit(rect, field, value, { aspectRatio, bounds }) — single
  entry point for an edit + aspect-ratio couple + bound clamp, with an
  aspect-ratio-aware envelope so a locked-ratio edit cannot drift the
  ratio when one axis exceeds the image.
- getCropPixelRect / cropPixelRectToNormalizedRect /
  clampCropPixelRectToBounds — pixel-space helpers.
- validateCropPixelRectAgainstBounds — { ok: true | false } diagnostic
  result for automation / AI consumers.
- fineRotation policy — shared by the bottom toolbar ruler and the
  advanced panel. Pulls offsets strictly inside ±MAX_ROTATION_OFFSET to
  prevent the snap-base spiral on repeated edits.

React layer:
- CropperProvider holds one context with the controller, the measured
  canvas size, and the derived measurements.
- useDerivedCropperMeasurements is the single derivation hook used by
  the Provider and by <Cropper>.
- useDeferredCommit owns the focused-draft state machine. While focused,
  the input is sovereign: external state changes (settle, sibling
  commits, undo/redo) do not replace the typed draft, and out-of-range
  drafts stay editable. Dirty drafts clamp and commit once on blur or
  Enter; Escape rolls back to the focus-time value.
- useAdvancedCropControls supplies the panel's data and handlers.
- <Cropper> publishes raw canvas size into the Provider; nothing pushes
  derived state back through a sibling context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds pauseHistory / resumeHistory to useCropperState so input-driven
edit sessions no longer accumulate intermediate undo entries on typing
pauses. Wires the new pair through useDeferredCommit, CropInput, and
useAdvancedCropControls: focus pauses the auto-history debounce,
blur/Enter resumes it, and the session's single entry lands via the
existing settleCrop -> commitHistory path.

useDeferredCommit cleans up an active session on unmount so a modal
close mid-edit flushes any pending commit and releases the pause.

useCropperState routes all reducer dispatches through a dispatchAction
wrapper that mirrors the reducer result into stateRef synchronously, so
same-tick setter + commitHistory sequences see the right state. The
reducer must stay pure (called again when React commits).
Restyles the panel-driven preview rect to match the real stencil and
moves the dimming and rule-of-thirds grid to follow it. While a preview
is active the stencil itself is hidden (opacity: 0) and the preview
stands in for it, so a user typing into the panel sees "the crop moved"
rather than "a new dashed rectangle appeared on top of the crop".

Also drops about 280 lines of duplicated test coverage. The panel test
no longer re-runs behaviour already covered at the hook level (fine
rotation policy, pause/resume bracketing, near-integer drift, external
state changes). The deferred-commit unmount + session-end-once tests
collapse into one parameterised test each.
Adds a new function, normalizeOffsetForDisplay, to ensure that the fine rotation offset is correctly normalized for user display. This change prevents discrepancies between the internal representation and the public endpoint of ±45°. The offsetFromState method is updated to utilize this new normalization function, enhancing the accuracy of rotation adjustments in the media editor.
…Enter key behavior

- Updated the onBlur function to use a local variable for clarity.
- Enhanced the logic to ensure previews are cleared correctly when Enter triggers a blur event.
- Added a new test case to verify that deferred previews are cleared as expected upon Enter key press.
…just border properties for the advanced crop panel. This change enhances the visual alignment of the panel within the media editor interface.
The use-recommended-components lint rule rejects Flex and FlexItem from
@wordpress/components. The two-input rows (X/Y, Width/Height) now use
Stack from @wordpress/ui, with a stylesheet rule giving each input an
equal share of the row (what FlexItem isBlock did). The single Fine
rotation input no longer needs a row wrapper: as a direct child of the
column Stack it already stretches to full width.
trunk removed the /** WordPress dependencies */ separators repo-wide and
turned on @wordpress/dependency-group and import/order (#81248), so the
import blocks in the files this branch adds no longer pass lint. Remove
the separator comments and the blank lines between import groups.
trunk now picks the unit test environment from the filename (#80991) and
typechecks test files through the split dev tsconfig (#81515). Rename the
four tests that need a DOM to *.jsdom.test.tsx, and hold the narrowed
controls in a const in use-advanced-crop-controls so the isReady check
still applies inside the act callbacks.
The panel layout refactor (#81840) replaced the ComplementaryArea wrapper
with a Tabs panel, so .media-editor__sidebar-panel no longer exists and
the rule that strips PanelBody's border and padding stopped matching.
Target .media-editor__panel, the class the pane now carries.
The session boundary (#83550) moved the cropper controller under
session.cropper, so state, setCropRect, setRotation and settleCrop no
longer sit at the top level of what useMediaEditor() returns. Read them
from the cropper, keep beginGesture and endGesture on the session, and
hand CropperProvider the cropper rather than the whole session.
The repository finished its Jest to Vitest migration (#82211, #80995,
#82742) and dropped the Jest globals, so these tests import describe, it
and expect, call vi in place of jest, and use the typed
vi.mock( import( … ) ) form the conventions check requires. The crop
panel mocks also follow the session shape. In the cropper suite, which
trunk moved to Browser Mode, the ported preview and unmount tests render
through renderCropper and click with userEvent.
The upgrade (#82731) rewraps a union type and an indent in these two
files.
@ramonjd
ramonjd force-pushed the try/image-editor-geometry-api-refactor branch from 6a8a744 to 1b8b59c Compare October 2, 2026 02:45
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +4.57 kB (+0.06%)

Total Size: 8.26 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 620 kB +4.25 kB (+0.69%)
build/styles/editor/style-rtl.css 32 kB +82 B (+0.26%)
build/styles/editor/style-rtl.min.css 27.3 kB +75 B (+0.28%)
build/styles/editor/style.css 32.1 kB +83 B (+0.26%)
build/styles/editor/style.min.css 27.3 kB +76 B (+0.28%)

2a6b098 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric c333501 trunk % Change
timeToFirstByte 56.7 ms +10.93% -2.82% 56.6 ms +10.07% -1.86% 0.18%
largestContentfulPaint 96 ms +8.33% -8.33% 98 ms +2.04% -10.2% -2.04%
lcpMinusTtfb 34.65 ms +18.04% -3.46% 34.4 ms +17.88% -5.67% 0.73%
wpBeforeTemplate 27.84 ms +19.15% -1.29% 28.27 ms +13.48% -1.31% -1.52%
wpTemplate 24.33 ms +3.58% -2.67% 24.57 ms +3.34% -2.69% -0.98%
wpTotal 53.13 ms +10.09% -2.77% 52.99 ms +10.21% -1.98% 0.26%
wpMemoryUsage 7.62 MB +0% -0% 7.59 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric c333501 trunk % Change
timeToFirstByte 47.05 ms +4.68% -1.28% 42.75 ms +6.67% -0.7% 10.06%
largestContentfulPaint 104 ms +0% -1.92% 90 ms +4.44% -2.22% 15.56%
lcpMinusTtfb 56.55 ms +1.24% -4.77% 46.2 ms +6.82% -1.95% 22.4%
wpBeforeTemplate 26.08 ms +1.3% -1.8% 26.51 ms +2.49% -1.7% -1.62%
wpTemplate 17.81 ms +2.98% -2.25% 13.63 ms +3.08% -0.51% 30.67%
wpTotal 44.15 ms +4.55% -1.63% 40.08 ms +6.39% -0.9% 10.15%
wpMemoryUsage 6.25 MB +0% -0% 6.07 MB +0% -0% 2.92%
wpDbQueries 14 +0% -0% 10 +0% -0% 40%

media-processing

Metric c333501 trunk % Change
mediaProcessingJpeg 399.09 ms +0.57% -0.53% 402.53 ms +0.23% -0.81% -0.85%
mediaProcessingAvif 6058.66 ms +0.36% -0.17% 6079.19 ms +0.48% -0.07% -0.34%
mediaProcessingJpegToAvif 4176.22 ms +0.24% -0.22% 4193.38 ms +0.16% -0.36% -0.41%

media-upload

Metric c333501 trunk % Change
jpegUploadProcessing 1442.01 ms +34.25% -1.68% 1447.38 ms +0.07% -1.83% -0.37%
pngUploadProcessing 177.65 ms +22.04% -2.09% 178.62 ms +3.99% -3.85% -0.54%
largeJpegUploadProcessing 1411.56 ms +0.83% -1.14% 1409.41 ms +0.22% -0.54% 0.15%
multipleImageUploadProcessing 1553.56 ms +0.83% -0.22% 1570.47 ms +9.13% -1.45% -1.08%

post-editor

Metric c333501 trunk % Change
serverResponse 249.86 ms +4.05% -10.63% 249.95 ms +4.5% -5.22% -0.04%
firstPaint 145.24 ms +80.25% -1.82% 177.57 ms +44.86% -32.16% -18.21%
domContentLoaded 633.36 ms +3.36% -1.01% 654.34 ms +2.47% -2.45% -3.21%
loaded 634.18 ms +3.39% -0.92% 655.33 ms +2.48% -2.48% -3.23%
firstContentfulPaint 278.67 ms +9.88% -3.5% 293.52 ms +1.05% -5.3% -5.06%
firstBlock 1829.95 ms +3.1% -2.28% 1907.98 ms +2.37% -2.1% -4.09%
type 12.31 ms +3.82% -2.11% 13.56 ms +5.01% -5.46% -9.22%
typeWithoutInspector 12.1 ms +1.49% -2.15% 12.89 ms +6.59% -4.5% -6.13%
typeWithTopToolbar 15.43 ms +0.84% -2.53% 16.35 ms +1.71% -3.55% -5.63%
typeContainer 5.3 ms +17.74% -4.72% 6.07 ms +3.46% -5.77% -12.69%
focus 42.06 ms +8.44% -4.83% 42.38 ms +6.28% -7.55% -0.76%
firstFocus 122.13 ms +0% -0% 127.37 ms +0% -0% -4.11%
selectAll 316.57 ms +3.65% -8.43% 315.19 ms +14.75% -10.17% 0.44%
listViewOpen 34.82 ms +11.4% -12.15% 35.75 ms +3.44% -9.51% -2.6%
inserterOpen 15.35 ms +4.36% -5.54% 16.69 ms +7.91% -11.32% -8.03%
inserterHover 1.65 ms +2.42% -18.18% 1.53 ms +7.84% -7.19% 7.84%
inserterSearch 5.95 ms +2.69% -6.05% 6.21 ms +3.54% -6.28% -4.19%
loadPatterns 413.45 ms +2.29% -2.17% 409.71 ms +3.04% -2.09% 0.91%
wpTotal 243.29 ms +3.84% -10.9% 243.17 ms +4.52% -5.28% 0.05%
wpMemoryUsage 13.17 MB +0% -0% 13.13 MB +0% -0% 0.28%
wpDbQueries 54 +0% -0% 54 +0% -0% 0%

site-editor

Metric c333501 trunk % Change
serverResponse 494.35 ms +9.26% -5.52% 490.8 ms +4.96% -6.83% 0.72%
firstPaint 240.77 ms +8.59% -8.51% 253.58 ms +17.8% -9.63% -5.05%
domContentLoaded 1153.23 ms +0.8% -2.52% 1157.16 ms +1.88% -1.03% -0.34%
loaded 1154.5 ms +0.81% -2.51% 1158.44 ms +1.88% -1.04% -0.34%
firstContentfulPaint 457.79 ms +2.23% -1.34% 457.82 ms +1.11% -1.65% -0.01%
firstBlock 4242.07 ms +0.95% -1.07% 4198.89 ms +0.75% -0.42% 1.03%
type 18.12 ms +3.15% -5.52% 19.25 ms +2.13% -10.03% -5.87%
navigate 121.6 ms +1.27% -5.42% 103.45 ms +14.59% -3.59% 17.54%
loadPatterns 1500.34 ms +4.67% -7.54% 1348.03 ms +7.41% -3.77% 11.3%
loadPages 1082.73 ms +2.87% -2.28% 1062.72 ms +3.08% -1.07% 1.88%
wpTotal 484.92 ms +9.34% -5.98% 480.99 ms +5.01% -7% 0.82%
wpMemoryUsage 12.14 MB +0% -0% 12.10 MB +0% -0% 0.4%
wpDbQueries 43 +2.33% -0% 43.5 +1.15% -1.15% -1.15%

2a6b098 Run

The crop panel already disables the transform controls and the aspect
ratio select while a save runs (#82417), but the Advanced fields stayed
live, so a crop could be typed into an edit that was on its way to the
server. Pass the flag down and combine it with each field's own
editability test.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Media Anything that impacts the experience of managing media [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants